package com.citicup.backend.entity;

import javax.persistence.*;

@Entity
@Table(name = "fund_daily", schema = "citicup2020")
public class FundDaily {
    private int id;
    private Double value;
    private Double acValue;
    private Double monthRate;
    private Double threeMonthsRate;
    private Double sixMonthsRate;
    private Double yearRate;
    private Double threeYearsRate;
    private Double allRate;
    private String date;
    private String fundCode;
    private Double dayRate;
    private Double weekRate;

    @Id
    @Column(name = "id")
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "value")
    public Double getValue() {
        return value;
    }

    public void setValue(Double value) {
        this.value = value;
    }

    @Basic
    @Column(name = "ac_value")
    public Double getAcValue() {
        return acValue;
    }

    public void setAcValue(Double acValue) {
        this.acValue = acValue;
    }

    @Basic
    @Column(name = "month_rate")
    public Double getMonthRate() {
        return monthRate;
    }

    public void setMonthRate(Double monthRate) {
        this.monthRate = monthRate;
    }

    @Basic
    @Column(name = "three_months_rate")
    public Double getThreeMonthsRate() {
        return threeMonthsRate;
    }

    public void setThreeMonthsRate(Double threeMonthsRate) {
        this.threeMonthsRate = threeMonthsRate;
    }

    @Basic
    @Column(name = "six_months_rate")
    public Double getSixMonthsRate() {
        return sixMonthsRate;
    }

    public void setSixMonthsRate(Double sixMonthsRate) {
        this.sixMonthsRate = sixMonthsRate;
    }

    @Basic
    @Column(name = "year_rate")
    public Double getYearRate() {
        return yearRate;
    }

    public void setYearRate(Double yearRate) {
        this.yearRate = yearRate;
    }

    @Basic
    @Column(name = "three_years_rate")
    public Double getThreeYearsRate() {
        return threeYearsRate;
    }

    public void setThreeYearsRate(Double threeYearsRate) {
        this.threeYearsRate = threeYearsRate;
    }

    @Basic
    @Column(name = "all_rate")
    public Double getAllRate() {
        return allRate;
    }

    public void setAllRate(Double allRate) {
        this.allRate = allRate;
    }

    @Basic
    @Column(name = "date")
    public String getDate() {
        return date;
    }

    public void setDate(String date) {
        this.date = date;
    }

    @Basic
    @Column(name = "fund_code")
    public String getFundCode() {
        return fundCode;
    }

    public void setFundCode(String fundCode) {
        this.fundCode = fundCode;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        FundDaily fundDaily = (FundDaily) o;

        if (id != fundDaily.id) return false;
        if (value != null ? !value.equals(fundDaily.value) : fundDaily.value != null) return false;
        if (acValue != null ? !acValue.equals(fundDaily.acValue) : fundDaily.acValue != null) return false;
        if (monthRate != null ? !monthRate.equals(fundDaily.monthRate) : fundDaily.monthRate != null) return false;
        if (threeMonthsRate != null ? !threeMonthsRate.equals(fundDaily.threeMonthsRate) : fundDaily.threeMonthsRate != null)
            return false;
        if (sixMonthsRate != null ? !sixMonthsRate.equals(fundDaily.sixMonthsRate) : fundDaily.sixMonthsRate != null)
            return false;
        if (yearRate != null ? !yearRate.equals(fundDaily.yearRate) : fundDaily.yearRate != null) return false;
        if (threeYearsRate != null ? !threeYearsRate.equals(fundDaily.threeYearsRate) : fundDaily.threeYearsRate != null)
            return false;
        if (allRate != null ? !allRate.equals(fundDaily.allRate) : fundDaily.allRate != null) return false;
        if (date != null ? !date.equals(fundDaily.date) : fundDaily.date != null) return false;
        if (fundCode != null ? !fundCode.equals(fundDaily.fundCode) : fundDaily.fundCode != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id;
        result = 31 * result + (value != null ? value.hashCode() : 0);
        result = 31 * result + (acValue != null ? acValue.hashCode() : 0);
        result = 31 * result + (monthRate != null ? monthRate.hashCode() : 0);
        result = 31 * result + (threeMonthsRate != null ? threeMonthsRate.hashCode() : 0);
        result = 31 * result + (sixMonthsRate != null ? sixMonthsRate.hashCode() : 0);
        result = 31 * result + (yearRate != null ? yearRate.hashCode() : 0);
        result = 31 * result + (threeYearsRate != null ? threeYearsRate.hashCode() : 0);
        result = 31 * result + (allRate != null ? allRate.hashCode() : 0);
        result = 31 * result + (date != null ? date.hashCode() : 0);
        result = 31 * result + (fundCode != null ? fundCode.hashCode() : 0);
        return result;
    }

    @Basic
    @Column(name = "day_rate")
    public Double getDayRate() {
        return dayRate;
    }

    public void setDayRate(Double dayRate) {
        this.dayRate = dayRate;
    }

    @Basic
    @Column(name = "week_rate")
    public Double getWeekRate() {
        return weekRate;
    }

    public void setWeekRate(Double weekRate) {
        this.weekRate = weekRate;
    }
}
